package com.jyx.healthsys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("notice")
public class Notice implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @TableField(value = "notice_name")
    private String noticeName;
    @TableField(value = "notice_content")
    private String noticeContent;
    @TableField(value = "status")
    private String status;
    @TableField(value = "deleted")
    private Integer deleted;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Notice notice = (Notice) o;
        return id == notice.id && status == notice.status && Objects.equals(noticeName, notice.noticeName) && Objects.equals(noticeContent, notice.noticeContent);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, noticeName, noticeContent, status);
    }
}
